package cn.shadow.test;

public interface AbstractFactory {
    TV getTv();

    PC getPc();

    static void main(String[] args) {
        AbstractFactory factory = new KiangjiaFactory();
        TV tv = factory.getTv();
        System.out.println(tv);
    }
}


class KiangjiaFactory implements AbstractFactory {
    @Override
    public TV getTv() {
        return new KangJiaTv();
    }

    @Override
    public PC getPc() {
        return new KangJiaPC();
    }
}

class HuaweiFactory implements AbstractFactory {
    @Override
    public TV getTv() {
        return new HUAWEITV();
    }

    @Override
    public PC getPc() {
        return new HUAWEIPC();
    }
}

interface TV {
}

interface PC {
}

class KangJiaTv implements TV {
    public KangJiaTv() {

    }
}

class HUAWEITV implements TV {
    public HUAWEITV() {

    }
}

class KangJiaPC implements PC {
    public KangJiaPC() {

    }
}

class HUAWEIPC implements PC {
    public HUAWEIPC() {

    }
}